<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <script src="../avalon1.4/avalon.js" ></script>
    <script>
        var model = avalon.define({
            $id: "test",
            aaa: "1111",
            nan: NaN,
            object: {a: 1, b: 3},
            array: [1, 2,4],
            ddd: "1",
            $skipArray: ["ddd"],
            click: function(a) {
                if (a == "object") {
                    model[a] = {a: 1, b: 2}
                } else if (a == "array") {
                    model[a] = [1, 2]
                } else if (a == "nan") {
                    model[a] = NaN//不算修改
                } else {
                    model[a] = "1111"//不算修改
                }
            }
        })
//        alert(NaN===NaN);
//        alert(NaN==NaN);
        model.$watch("$all", function(name, a, b) {
            console.log(name, a, b)
        })

    </script>
    <style>
        .ms-hover div:hover{
            background:yellowgreen;
        }
    </style>
</head>
<body ms-controller="test" class='ms-hover'>
<div ms-click="click('aaa')">{{aaa}}</div>
<div ms-click="click('nan')">{{nan}}</div>
<div ms-click="click('object')">
    <div ms-repeat='object'>{{$key}}</div>
</div>
<div ms-click="click('array')">
    <div ms-repeat='array'>{{el}}</div>
</div>
<div ms-click="click('ddd')">{{ddd}}</div>
</body>
</html>